<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateFormularioTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateFormularioLabel_nombre}" for="nombre" />
                    <h:inputText id="nombre" value="#{formularioController.selected.nombre}" title="#{bundle.CreateFormularioTitle_nombre}"/>

                    <h:outputLabel value="#{bundle.CreateFormularioLabel_descripcion}" for="descripcion" />
                    <h:inputText id="descripcion" value="#{formularioController.selected.descripcion}" title="#{bundle.CreateFormularioTitle_descripcion}" />

                    <h:outputLabel value="#{bundle.CreateFormularioLabel_html}" for="html" />
                    <h:inputText id="html" value="#{formularioController.selected.html}" title="#{bundle.CreateFormularioTitle_html}"/>
                </h:panelGrid>
                <br />
                <br />
                <br />
                <h:outputLabel value="Atributos"/>
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListCampoEmpty}" rendered="#{formularioController.itemsCampo.rowCount == 0}"/>
                <h:panelGroup rendered="#{formularioController.itemsCampo.rowCount > 0}">
                    <h:outputText value="#{formularioController.paginationCampo.pageFirstItem + 1}..#{formularioController.paginationCampo.pageLastItem + 1}/#{formularioController.paginationCampo.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{formularioController.previousCampo}" value="#{bundle.Previous} #{formularioController.paginationCampo.pageSize}" rendered="#{formularioController.paginationCampo.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{formularioController.nextCampo}" value="#{bundle.Next} #{formularioController.paginationCampo.pageSize}" rendered="#{formularioController.paginationCampo.hasNextPage}"/>&nbsp;
                    <h:dataTable value="#{formularioController.itemsCampo}" var="campo" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListCampoTitle_nombre}"/>
                            </f:facet>
                            <h:commandLink action="#{formularioController.prepareViewCampo}" value="#{campo.nombre}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{formularioController.prepareEditCampo}" value="#{bundle.ListCampoEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{formularioController.destroyCampo}" value="#{bundle.ListCampoDestroyLink}"/>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
                <br />
                <br />
                <br />
                <h:commandLink action="#{formularioController.prepareCreateTexto}" value="#{bundle.CrearCampoTexto}"/>
                <br />
                <h:commandLink action="#{formularioController.prepareCreateNumerico}" value="#{bundle.CrearCampoNumerico}"/>
                <br />
                <h:commandLink action="#{formularioController.prepareCreateLogico}" value="#{bundle.CrearCampoLogico}"/>
                <br />
                <h:commandLink action="#{formularioController.prepareCreateFecha}" value="#{bundle.CrearCampoFecha}"/>
                <br />
                <h:commandLink action="#{formularioController.prepareCreateLink}" value="#{bundle.CrearCampoLink}"/>
                <br />
                <h:commandLink action="#{formularioController.prepareCreateListaValores}" value="#{bundle.CrearCampoListaValores}"/>
                <br />
                <br />
                <br />
                <h:commandLink action="#{formularioController.create}" value="#{bundle.CreateFormularioSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{formularioController.prepareList}" value="#{bundle.CreateFormularioShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateFormularioIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
